<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/common/header.jsp"%>
<html>
<head>
<script type="text/javascript">
	//启用会员账户操作
	function enableCustomer(url) {
		asyncOper(url, "确定要启用这些会员吗");
	}
	//冻结会员账户操作
	function stopCustomer(url) {
		asyncOper(url, "确定要冻结这些会员吗");
	}
	//查看会员详细信息
	function showCustomAccountDetail() {
		var checkedItems = checkSelected("customerAccTableId", true);
		commonDetail("../customerinfo/getCustomerDetail.do?custom_uuid="+(checkedItems[0]).CUSTOM_UUID, "", "customerAccTableId");
	}
	
	function asyncOper(url, msg){
		commonAsync(url, "customerAccTableId", msg, function(result){
			grid.reload();
		});
	}
</script>
</head>
<body class="easyui-layout list_body">
	<form id="customerAccForm" name="customerAccForm">
		<div class="list_body_north" data-options="region:'north'" border="false">
			<!-- 查询表单 -->
			<div style="padding: 3px" class="easyui-panel datagrid-toolbar">
				<div>
					<span>会员编号:</span>
					<input type="text" id="custom_no" name="custom_no" class="easyui-textbox"/>  
					<span>手机号:</span>
					<input type="text" id="phone" name="phone" class="easyui-textbox"/> 
					<span>会员名称:</span>
					<input type="text" id="name" name="name" class="easyui-textbox"/>
					<span>账户状态:</span>
					<code:codeSelect name="account_st" id="account_st" code_type="ACCOUNT_ST" showSelect="true"></code:codeSelect>
					<span>账户类型:</span>
					<code:codeSelect name="account_type" id="account_type" code_type="ACCOUNT_TYPE" showSelect="true"></code:codeSelect>
					<br>
					<span>机构号:</span>
					<input type="text" id="ins_cd" name="ins_cd" class="easyui-textbox"/> 
					<span>机构名称:</span>
					<input type="text" id="ins_name" name="ins_name" class="easyui-textbox"/> 
					<a href="#" class="easyui-linkbutton btn" iconCls="icon-search" onclick="doSearch()">查询</a>
					<a href="#" class="easyui-linkbutton btn" iconCls="icon-reload" onclick="resetForm()">重置</a>
				</div>
			</div>
			<!-- 自定义标签工具栏 -->
			<jiepos:buttonOperateTag menuCode="${menuCode }"></jiepos:buttonOperateTag>
		</div>
		<div data-options="region:'center'" border="false" class="list_body_center">
			<!-- 表格 -->
			<table id="customerAccTableId" fit="true"></table>
		</div>
	</form>
</body>
<script type="text/javascript">
	var grid;
	$(function() {
		/*加载表格数据*/
		grid = $("#customerAccTableId").jpgrid({
			url : "getCustomerAccountListJson.do",
			columns : [ {
				title : "会员编号",
				field : "CUSTOM_NO",
				align : 'center'
			}, {
				title : "会员名称",
				field : "NAME",
				align : 'center'
			}, {
				title : "账户状态",
				field : "ACCOUNT_ST_NAME",
				align : 'center',
				width:80
			}, {
				title : "账户类型",
				field : "ACCOUNT_TYPE_NAME",
				align : 'center',
				width:100
			}, {
				title : "账户余额",
				field : "BALANCE",
				align : 'center',
				width:80
			}, {
				title : "可用余额",
				field : "HAVE_BALACE",
				align : 'center',
				width:80
			}, {
				title : "已支取金额",
				field : "CASH_BALANCE",
				align : 'center',
				width:80
			}, {
				title : "所属机构",
				field : "INS_CN_NM",
				align : 'center'
			}]
		});
	});

	function doSearch() {
		grid.load({
			phone : $('#phone').val(),
			name : $('#name').val(),
			account_st : $('#account_st').val(),
			ins_cd : $('#ins_cd').val(),
			ins_name : $("#ins_name").val(),
			account_type : $("#account_type").val(),
			custom_no : $("#custom_no").val()
		});
	}
</script>
</html>
